{% extends 'base.html' %}
{% load static %}
{% block title %}注册{% endblock %}
{% block css %}<link href="{% static 'login.css' %}" rel="stylesheet"/>{% endblock %}


{% block content %}
    <div class="container">
        <div class="col-md-4 col-md-offset-4">
          <form class='form-register' action="/register/" method="post">
              {% csrf_token %}
              <h2 class="text-center">注册账户</h2>

               <div class="form-group">
                  {{ register_form.username.label_tag }}
                  {{ register_form.username }}
               </div>
              <div class="form-group">
                  {{ register_form.password1.errors }}
                  {{ register_form.password1.label_tag }}
                  {{ register_form.password1 }}
              </div>
              <div class="form-group">
                  {{ register_form.password2.errors }}
                  {{ register_form.password2.label_tag }}
                  {{ register_form.password2 }}
              </div>

              <button type="reset" class="btn btn-default pull-left">重置</button>
              <button type="submit" class="btn btn-primary pull-right">提交</button>
          </form>
        </div>
    </div> <!-- /container -->
 {% if messages %}
    <script>
        {% for msg in messages %}
            alert('{{ msg.message }}');
        {% endfor %}
    </script>
{% endif %}


{% endblock %}